package org.dromara.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.dromara.system.domain.ReceiveDealRecordsReqDTO;
import org.dromara.system.domain.bo.kq.KQTradingWaterBo;
import org.dromara.system.domain.bo.ld.LDTradingWaterReqDTO;
import org.dromara.system.domain.bo.lsqdb.LSQDBTradingWaterBo;
import org.dromara.system.domain.bo.mxj.MXJTradingWaterBo;
import org.dromara.system.domain.bo.qbqdb.QBQDBTradingWaterBo;
import org.dromara.system.domain.bo.zzb.ZZBTradingWaterBo;

import java.util.Arrays;

/**
 * @author 王星
 * @date 2024/6/3 上午9:24
 */
@Getter
@AllArgsConstructor
public enum NotificationEnum {

    KYT("KYT", "快易通", "org.dromara.system.service.impl.trading.channel.KYTTradingService",
        "kYTTradingService", ReceiveDealRecordsReqDTO.class),

    MXJ("MXJ", "梦想家", "org.dromara.system.service.impl.trading.channel.MXJTradingService",
        "mXJTradingService", MXJTradingWaterBo.class),

    LD("LD", "联动", "org.dromara.system.service.impl.trading.channel.LDTradingService",
        "lDTradingService", LDTradingWaterReqDTO.class),

    LS_QD("LS_QD", "乐刷渠道版", "org.dromara.system.service.impl.trading.channel.LSQDTradingService",
        "lSQDTradingService", LSQDBTradingWaterBo.class),

    QB_QD("QB_QD", "钱宝渠道版", "org.dromara.system.service.impl.trading.channel.QBQDTradingService",
        "qBQDTradingService", QBQDBTradingWaterBo.class),

    ZZB("ZZB", "掌中宝", "org.dromara.system.service.impl.trading.channel.ZZBTradingService",
        "zZBTradingService", ZZBTradingWaterBo.class),

    KQ("KQ", "快钱", "org.dromara.system.service.impl.trading.channel.KQTradingService",
        "kQTradingService", KQTradingWaterBo.class),
    ;
    @JsonValue
    @EnumValue
    private final String code;

    private final String desc;
    private final String path;
    private final String name;
    private final Class<?> clazz;


    public static NotificationEnum findOneByCode(String code) {
        return Arrays.stream(NotificationEnum.values())
            .filter(type -> type.getCode().equals(code)).findAny().orElse(null);
    }


}
